package com.zb.controller;

import com.zb.yaml.DomainPath;
import com.zb.yaml.MobilePath;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author WEN
 * @Date 2024/3/30 0030
 **/
@Api(tags = "重定向类接口")
@Controller
public class RedirectController {

    @ApiOperation("邀请服务商加入平台")
    @GetMapping("/RT{inviteCode}")
    public void redirectToInviteNetworkPage(@PathVariable @ApiParam(value = "邀请码", required = true) String inviteCode, HttpServletResponse response) {
        String redirectUrl = MobilePath.getInviteCodeJoinCustomer() + inviteCode;
        try {
            response.sendRedirect(redirectUrl);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
